home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2001 May / macformat_103_may_2001.iso / Mac OS X Shareware / Fizilla / Chrome / toolkit.jar / content / global / xulBindings.xml < prev   
Encoding:
Extensible Markup Language  |  2001-03-26  |  27.4 KB  |  682 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!DOCTYPE window [
  4. <!ENTITY % textcontextDTD SYSTEM "chrome://global/locale/textcontext.dtd" >
  5. %textcontextDTD;
  6. ]>
  7.  
  8. <bindings id="xulBindings"
  9.    xmlns="http://www.mozilla.org/xbl"
  10.    xmlns:html="http://www.w3.org/1999/xhtml"
  11.    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
  12.   
  13.   <binding id="thumb" extends="xul:box">
  14.     <content>
  15.       <xul:spring flex="1"/>
  16.       <xul:image inherits="src"/>
  17.       <xul:spring flex="1"/>
  18.     </content>
  19.   </binding>
  20.  
  21.   <binding id="slider">
  22.     <content>
  23.       <xul:thumb inherits="align,src" flex="1"/>
  24.     </content>
  25.   </binding>
  26.  
  27.   <binding id="scrollbar">
  28.     <content>
  29.       <xul:scrollbarbutton type="decrement">
  30.         <xul:image inherits="src"/>
  31.       </xul:scrollbarbutton>
  32.       <xul:slider flex="1" inherits="curpos,maxpos,pageincrement,increment"/>
  33.       <xul:scrollbarbutton type="increment">
  34.       <xul:image inherits="src"/>
  35.     </xul:scrollbarbutton>
  36.     </content>
  37.   </binding>
  38.  
  39.   <binding id="tab">
  40.     <content>
  41.       <xul:image inherits="src" class="tab-left"/>
  42.       <xul:text flex="1" inherits="value=label,crop,accesskey" crop="right" class="tab-text"/>
  43.     </content>
  44.   </binding>
  45.  
  46.  
  47.   <binding id="menu-menubar">
  48.     <content>
  49.       <xul:text class="menubar-text" inherits="value=label,accesskey,crop" crop="right"/>
  50.       <children includes="menupopup"/>
  51.     </content>
  52.   </binding>
  53.  
  54.   <binding id="menu-menubar-iconic">
  55.     <content>
  56.       <xul:image class="menubar-left"/>
  57.       <xul:text class="menubar-text" inherits="value=label,accesskey,crop" crop="right"/>
  58.       <children includes="menupopup"/>
  59.     </content>
  60.   </binding>
  61.  
  62.   <binding id="menu">
  63.     <content autostretch="never">
  64.       <xul:text class="menu-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
  65.       <xul:text class="menu-accel" inherits="value=acceltext"/>
  66.       <xul:box autostretch="never" class="menu-right" inherits="menuactive,disabled">
  67.         <xul:image/>
  68.       </xul:box>
  69.       <children includes="menupopup"/>
  70.     </content>
  71.     <implementation>
  72.       <property name="value" onset="this.setAttribute('value',val); return val;"
  73.                             onget="return this.getAttribute('value');"/>
  74.     </implementation>  
  75.   </binding>
  76.  
  77.   <binding id="menuitem">
  78.     <content autostretch="never">
  79.       <xul:text class="menu-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
  80.       <xul:text class="menu-accel" inherits="value=acceltext"/>
  81.     </content>
  82.     <implementation>
  83.       <property name="value" onset="this.setAttribute('value',val); return val;"
  84.                             onget="return this.getAttribute('value');"/>
  85.     </implementation>  
  86.   </binding>
  87.  
  88.   <binding id="menuitem-iconic">
  89.     <content>
  90.       <xul:box class="menu-iconic-left" orient="vertical" autostretch="never" inherits="selected,menuactive,disabled,checked">
  91.         <xul:image inherits="src"/>
  92.       </xul:box>
  93.       <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
  94.       <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
  95.     </content>
  96.     <implementation>
  97.       <property name="value" onset="this.setAttribute('value',val); return val;"
  98.                             onget="return this.getAttribute('value');"/>
  99.     </implementation>  
  100.   </binding>
  101.  
  102.   <binding id="menu-iconic">
  103.     <content autostretch="never">
  104.       <xul:box class="menu-iconic-left" orient="vertical" autostretch="never">
  105.         <xul:image inherits="src"/>
  106.       </xul:box>
  107.       <xul:text class="menu-iconic-text" flex="1" align="left" inherits="value=label,accesskey,crop" crop="right"/>
  108.       <xul:text class="menu-iconic-accel" inherits="value=acceltext"/>
  109.       <xul:box orient="vertical" autostretch="never" class="menu-right" inherits="menuactive,disabled">
  110.         <xul:image/>
  111.       </xul:box>
  112.       <children includes="menupopup|template"/>
  113.     </content>
  114.     <implementation>
  115.       <property name="value" onset="this.setAttribute('value',val); return val;"
  116.                             onget="return this.getAttribute('value');"/>
  117.     </implementation>  
  118.   </binding>
  119.   
  120.   <binding id="basetext">
  121.     <implementation>
  122.       <!-- public implementation -->
  123.       <property name="label"      onset="return this.setAttribute('label',val);"
  124.                                   onget="return this.getAttribute('label');"/>
  125.       <property name="crop"       onset="return this.setAttribute('crop',val);"
  126.                                   onget="return this.getAttribute('crop');"/>
  127.       <property name="disabled"   onset="if (val) this.setAttribute('disabled', 'true');
  128.                                          else this.removeAttribute('disabled');
  129.                                          return val;"
  130.                                   onget="var v = this.getAttribute('disabled');
  131.                                          if (v == 'true') return true; return false;"/>                                  
  132.       <property name="src"        onset="return this.setAttribute('src',val);"
  133.                                   onget="return this.getAttribute('src');"/>
  134.       <property name="accesskey"  onset="return this.setAttribute('accesskey',val);"
  135.                                   onget="return this.getAttribute('accesskey');"/>
  136.       <property name="imgalign"   onset="return this.setAttribute('imgalign',val);"
  137.                                   onget="return this.getAttribute('imgalign');"/>
  138.     </implementation>      
  139.   </binding>
  140.   
  141.   <binding id="checkbox" extends="chrome://global/content/xulBindings.xml#basetext">
  142.     <content>
  143.       <xul:box flex="1" class="internal-box" autostretch="never" valign="top">
  144.         <xul:box class="checkmark-box" autostretch="never">
  145.           <xul:image class="checkbox-check"/>
  146.         </xul:box>
  147.         <xul:image class="checkbox-icon" inherits="src"/>
  148.         <xul:html class="checkbox-label" inherits="value=label,accesskey,crop" flex="1">
  149.           <children/>
  150.         </xul:html>
  151.       </xul:box>
  152.     </content>
  153.     <implementation>
  154.       <!-- public implementation -->
  155.       <property name="checked"    onset="if (val) this.setAttribute('checked', 'true');
  156.                                          else this.removeAttribute('checked');
  157.                                          return val;"
  158.                                   onget="var v = this.getAttribute('checked');
  159.                                          if (v == 'true') return true; return false;"/>
  160.     </implementation>
  161.     <handlers>
  162.       <handler event="click" button="0" action="if (!this.disabled) this.checked = !this.checked;"/>
  163.       <handler event="keypress" key=" " action="if (!this.disabled) this.checked = !this.checked;"/>
  164.     </handlers>
  165.   </binding>
  166.  
  167.   <!-- XUL <button>s -->
  168.   <binding id="buttonleft" extends="chrome://global/content/xulBindings.xml#basetext">
  169.     <content>
  170.       <xul:box class="button-internal-box" autostretch="never" flex="1">
  171.         <xul:image class="button-icon" inherits="src"/>
  172.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  173.           <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
  174.         </xul:box>
  175.       </xul:box>
  176.       <children includes="menupopup"/>
  177.     </content>
  178.   </binding>
  179.  
  180.   <binding id="buttontop" extends="chrome://global/content/xulBindings.xml#basetext">
  181.     <content>
  182.       <xul:box class="button-internal-box" orient="vertical" autostretch="never" flex="1">
  183.         <xul:image class="button-icon" inherits="src"/>
  184.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  185.           <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
  186.         </xul:box>
  187.       </xul:box>
  188.       <children includes="menupopup"/>
  189.     </content>
  190.   </binding>
  191.   
  192.   <binding id="buttonright" extends="chrome://global/content/xulBindings.xml#basetext">
  193.     <content>
  194.       <xul:box class="button-internal-box" inherits="orient" autostretch="never" flex="1">
  195.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  196.           <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
  197.         </xul:box>
  198.         <xul:image class="button-icon" inherits="src"/>
  199.       </xul:box>
  200.       <children includes="menupopup"/>
  201.     </content>
  202.   </binding>
  203.  
  204.   <binding id="buttonbottom" extends="chrome://global/content/xulBindings.xml#basetext">
  205.     <content>
  206.       <xul:box class="button-internal-box" orient="vertical" autostretch="never" flex="1">
  207.         <xul:box orient="vertical" class="button-text-container" autostretch="never" flex="1">
  208.           <xul:text class="button-text" inherits="value=label,accesskey,crop,dragover-top"/>
  209.         </xul:box>
  210.         <xul:image class="button-icon" inherits="src"/>
  211.       </xul:box>
  212.       <children includes="menupopup"/>
  213.     </content>
  214.   </binding>
  215.   
  216.   <binding id="separator" extends="xul:spring"/>
  217.  
  218.   <!-- appending to the end so we don't make hyatt cry -->
  219.   <binding id="progressmeter" extends="xul:box">
  220.     <content>
  221.       <xul:box class="progressmeter-internal-box" flex="1">
  222.         <xul:stack class="progressmeter-stack" flex="1">
  223.           <xul:progressbar class="progressmeter-progressbar" inherits="value,statusbar">
  224.             <xul:box class="progress-bar"/>
  225.             <xul:box class="progress-remainder"/>
  226.           </xul:progressbar>
  227.           <xul:box>
  228.             <xul:spring flex="1"/>
  229.             <xul:text class="progress-text" inherits="value=label"/>
  230.             <xul:spring flex="1"/>
  231.           </xul:box>
  232.         </xul:stack>
  233.       </xul:box>
  234.     </content>
  235.     <implementation>
  236.       <property name="label"   onset="if (this.label != val) this.setAttribute('label',val); return val;"
  237.                                       onget="return this.getAttribute('label');"/>
  238.       <property name="value" onget="return this.getAttribute('value');">
  239.       <setter>
  240.       <![CDATA[
  241.         var p = Math.round(val);
  242.       var c = this.value; 
  243.       if (p != c) {
  244.         var delta = p - c;
  245.         if (delta < 0) delta = -delta;
  246.         if (delta > 3 || p == 0 || p == 100) {
  247.           this.setAttribute('value',p); 
  248.         }
  249.         }
  250.       return p;
  251.       ]]>
  252.     </setter>
  253.     </property>
  254.       <property name="mode"           onset="if (this.mode != val) this.setAttribute('mode', val); return val;"
  255.                                       onget="return this.getAttribute('mode');"/>
  256.     </implementation>
  257.   </binding>
  258.  
  259.   <binding id="textbox" extends="xul:box">
  260.     <content context="_child">
  261.       <xul:box class="textbox-internal-box" flex="1">
  262.         <html:input class="textbox-input" flex="1" inherits="onfocus,onblur,value,type,maxlength,disabled,size,readonly"/>
  263.       </xul:box>
  264.       <xul:popupset>
  265.         <xul:popup oncreate="this.parentNode.parentNode.doPopupItemEnabling(this); this.focus();">
  266.           <xul:menuitem label="&undoCmd.label;" accesskey="&undoCmd.accesskey;" command="cmd_undo" oncommand="
  267.             var controller = document.commandDispatcher.getControllerForCommand('cmd_undo');              
  268.             controller.doCommand('cmd_undo');"/>
  269.           <xul:menuseparator/>
  270.           <xul:menuitem label="&cutCmd.label;" accesskey="&cutCmd.accesskey;" command="cmd_cut" oncommand="
  271.             var controller = document.commandDispatcher.getControllerForCommand('cmd_cut');
  272.             controller.doCommand('cmd_cut');"/>
  273.           <xul:menuitem label="©Cmd.label;" accesskey="©Cmd.accesskey;" command="cmd_copy" oncommand="
  274.             var controller = document.commandDispatcher.getControllerForCommand('cmd_copy');
  275.             controller.doCommand('cmd_copy');"/>
  276.           <xul:menuitem label="&pasteCmd.label;" accesskey="&pasteCmd.accesskey;" command="cmd_paste" oncommand="
  277.             var controller = document.commandDispatcher.getControllerForCommand('cmd_paste');
  278.             controller.doCommand('cmd_paste');"/>
  279.           <xul:menuitem label="&deleteCmd.label;" accesskey="&deleteCmd.accesskey;" command="cmd_delete" oncommand="
  280.             var controller = document.commandDispatcher.getControllerForCommand('cmd_delete');
  281.             controller.doCommand('cmd_delete');"/>
  282.            <xul:menuseparator/>
  283.           <xul:menuitem label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;" command="cmd_selectAll" oncommand="
  284.             var controller = document.commandDispatcher.getControllerForCommand('cmd_selectAll');
  285.             controller.doCommand('cmd_selectAll');"/>
  286.         </xul:popup>
  287.       </xul:popupset>
  288.     </content>
  289.     <implementation>
  290.       <property name="inputField" readonly="true">
  291.        <![CDATA[
  292.         var v = document.getAnonymousNodes(this);
  293.         var input = null;
  294.         for (var i = 0; i < v.length; i++) {
  295.           try {
  296.             var l = v[i].getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "input");
  297.             if (l.length > 0) {
  298.               input = l[0];
  299.               break;
  300.             }
  301.           } catch (e) {} 
  302.         }
  303.         input;
  304.       ]]>
  305.       </property>
  306.       <property name="value"      onset="this.inputField.value = val; return val;"
  307.                                   onget="return this.inputField.value;"/>
  308.       <property name="type"       onset="this.inputField.type = val; return val;"
  309.                                   onget="return this.inputField.type;"/>
  310.       <property name="maxlength"  onset="this.inputField.maxlength = val; return val;"
  311.                                   onget="return this.inputField.maxlength;"/>
  312.       <property name="disabled"   onset="this.inputField.disabled = val; return val;"
  313.                                   onget="return this.inputField.disabled;"/>
  314.       <property name="size"       onset="this.inputField.size = val; return val;"
  315.                                   onget="return this.inputField.size;"/>
  316.       <property name="readonly"   onset="this.inputField.readonly = val; return val;"
  317.                                   onget="return this.inputField.readonly;"/>
  318.  
  319.       <method name="select">
  320.         <body>
  321.           this.inputField.select();
  322.         </body>
  323.       </method>
  324.  
  325.       <method name="doPopupItemEnabling">
  326.         <parameter name="popupNode"/> 
  327.         <body>
  328.           <![CDATA[
  329.             var children = popupNode.childNodes;
  330.             for (var i = 0; i < children.length; i++) {              
  331.               var command = children[i].getAttribute("command");
  332.               if (command) {
  333.                 var controller = document.commandDispatcher.getControllerForCommand(command);
  334.                 var enabled = controller.isCommandEnabled(command);
  335.                 if (enabled)
  336.                   children[i].removeAttribute('disabled');
  337.                 else
  338.                   children[i].setAttribute('disabled','true');               
  339.               }
  340.             }
  341.           ]]>
  342.         </body>
  343.       </method>
  344.                              
  345.       
  346.       <property name="controllers"    readonly="true" onget="return this.inputField.controllers"/>
  347.       <property name="textLength"     readonly="true" onget="return this.inputField.textLength;"/>
  348.       <property name="selectionStart" onset="this.inputField.selectionStart = val; return val;"
  349.                                       onget="return this.inputField.selectionStart;"/>
  350.       <property name="selectionEnd"   onset="this.inputField.selectionEnd = val; return val;"
  351.                                       onget="return this.inputField.selectionEnd;"/>
  352.      
  353.       <property name="suppressFocusBlur">
  354.         false
  355.       </property>
  356.  
  357.       <method name="setSelectionRange">
  358.         <parameter name="aSelectionStart"/>
  359.         <parameter name="aSelectionEnd"/>
  360.         <body>
  361.           this.inputField.setSelectionRange( aSelectionStart, aSelectionEnd );
  362.         </body>
  363.       </method>
  364.  
  365.       <constructor action="var str = this.boxObject.getProperty('value'); 
  366.                                                 if (str) {
  367.                                                   this.inputField.value=str;
  368.                                                   this.boxObject.removeProperty('value');
  369.                                                 }"/>
  370.       <destructor action="if (this.inputField.value) this.boxObject.setProperty('value', this.inputField.value);"/>
  371.    
  372.     </implementation>
  373.     <handlers>
  374.       <handler event="focus" phase="capturing">
  375.       <![CDATA[
  376.         if (this.getAttribute('focused') != 'true') {
  377.           this.setAttribute('focused','true');
  378.           this.suppressFocusBlur = true;
  379.           if (document.commandDispatcher.focusedElement != this.inputField) 
  380.             this.inputField.focus();
  381.           this.suppressFocusBlur = false;
  382.         }
  383.       ]]>
  384.       </handler>
  385.       <handler event="blur" phase="capturing">
  386.       <![CDATA[
  387.         if (!this.suppressFocusBlur && this.getAttribute('focused') == 'true') {
  388.           this.removeAttribute('focused');
  389.         }
  390.       ]]>
  391.       </handler>
  392.     </handlers>    
  393.   </binding>
  394.  
  395.   <binding id="textarea" extends="chrome://global/content/xulBindings.xml#textbox">
  396.     <content context="_child">
  397.       <xul:box class="textarea-internal-box" flex="1">
  398.         <html:textarea class="textbox-textarea" flex="1" inherits="onfocus,onblur,value,disabled,rows,cols,readonly"/>
  399.       </xul:box>
  400.       <xul:popupset>
  401.         <xul:popup oncreate="this.parentNode.parentNode.doPopupItemEnabling(this); this.focus();">
  402.           <xul:menuitem label="&undoCmd.label;" accesskey="&undoCmd.accesskey;" command="cmd_undo" oncommand="
  403.             var controller = document.commandDispatcher.getControllerForCommand('cmd_undo');              
  404.             controller.doCommand('cmd_undo');"/>
  405.           <xul:menuseparator/>
  406.           <xul:menuitem label="&cutCmd.label;" accesskey="&cutCmd.accesskey;" command="cmd_cut" oncommand="
  407.             var controller = document.commandDispatcher.getControllerForCommand('cmd_cut');
  408.             controller.doCommand('cmd_cut');"/>
  409.           <xul:menuitem label="©Cmd.label;" accesskey="©Cmd.accesskey;" command="cmd_copy" oncommand="
  410.             var controller = document.commandDispatcher.getControllerForCommand('cmd_copy');
  411.             controller.doCommand('cmd_copy');"/>
  412.           <xul:menuitem label="&pasteCmd.label;" accesskey="&pasteCmd.accesskey;" command="cmd_paste" oncommand="
  413.             var controller = document.commandDispatcher.getControllerForCommand('cmd_paste');
  414.             controller.doCommand('cmd_paste');"/>
  415.           <xul:menuitem label="&deleteCmd.label;" accesskey="&deleteCmd.accesskey;" command="cmd_delete" oncommand="
  416.             var controller = document.commandDispatcher.getControllerForCommand('cmd_delete');
  417.             controller.doCommand('cmd_delete');"/>
  418.            <xul:menuseparator/>
  419.           <xul:menuitem label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;" command="cmd_selectAll" oncommand="
  420.             var controller = document.commandDispatcher.getControllerForCommand('cmd_selectAll');
  421.             controller.doCommand('cmd_selectAll');"/>
  422.         </xul:popup>
  423.       </xul:popupset>
  424.     </content>
  425.     <implementation>
  426.       <property name="inputField" readonly="true">
  427.        <![CDATA[
  428.         var v = document.getAnonymousNodes(this);
  429.         var input = null;
  430.         for (var i = 0; i < v.length; i++) {
  431.           try {
  432.             var l = v[i].getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "textarea");
  433.             if (l.length > 0) {
  434.               input = l[0];
  435.               break;
  436.             }
  437.           } catch (e) {} 
  438.         }
  439.         input;
  440.       ]]>
  441.       </property>
  442.     </implementation>
  443.   </binding>
  444.  
  445.   <binding id="text-label">
  446.     <handlers>
  447.       <handler event="click" action="var forElementID = this.getAttribute('for'); if(forElementID) var forElement = document.getElementById(forElementID); if(forElement) forElement.focus();"/>
  448.     </handlers>
  449.   </binding>
  450.   
  451.   <binding id="text-editable-display" extends="chrome://global/content/xulBindings.xml#text"/>
  452.   
  453.   <binding id="text-editable-edit" extends="xul:box">
  454.     <content>
  455.       <xul:box flex="1">
  456.         <html:input type="text" inherits="value,type,maxlength,disabled,size,readonly"/>
  457.       </xul:box>
  458.     </content>
  459.     <handlers>
  460.       <handler event="blur" action="this.setAttribute('mode','display');"/>
  461.     </handlers>
  462.   </binding>
  463.  
  464.   <binding id="tooltips" extends="chrome://global/content/xulBindings.xml#popups">
  465.     <content>
  466.       <xul:box class="popup-internal-box" orient="vertical" flex="1">
  467.         <children/>
  468.       </xul:box>
  469.     </content>
  470.   </binding>
  471.  
  472.   <binding id="popups">
  473.     <content>
  474.       <!--xul:box class="popup-internal-box" orient="vertical" flex="1" style="overflow: auto">
  475.         <children/>
  476.       </xul:box-->
  477.  
  478.       <xul:arrowscrollbox class="popup-internal-box" flex="1" orient="vertical">
  479.       <!--xul:box class="popup-internal-box" orient="vertical"-->
  480.       <children/>
  481.       <!--/xul:box-->
  482.       </xul:arrowscrollbox>
  483.  
  484.     </content>
  485.     <implementation>
  486.       <method name="openPopup">
  487.         <parameter name="element"/>
  488.         <parameter name="xpos"/>
  489.         <parameter name="ypos"/>
  490.         <parameter name="popuptype"/>
  491.         <parameter name="anchoralignment"/>
  492.         <parameter name="popupalignment"/>
  493.         <body>
  494.         <![CDATA[
  495.           try {
  496.             var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  497.           } catch(e) {}
  498.           try {
  499.             var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  500.           } catch(e) {}
  501.           if (popupSetBox)
  502.             popupSetBox.createPopup(element, this, xpos, ypos, popuptype, anchoralignment, popupalignment);
  503.           else if (menuBox)
  504.             menuBox.openMenu(true);
  505.         ]]>
  506.         </body>
  507.       </method>
  508.       <method name="closePopup">
  509.         <body>
  510.         <![CDATA[
  511.           try {
  512.             var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  513.           } catch(e) {}
  514.           try {
  515.             var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  516.           } catch(e) {}
  517.           if (popupSetBox)
  518.             popupSetBox.destroyPopup();
  519.           else if (menuBox)
  520.             menuBox.openMenu(false);
  521.         ]]>
  522.         </body>
  523.       </method>
  524.       <property name="activeChild">
  525.         <getter>
  526.           <![CDATA[
  527.             try {
  528.               var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  529.             } catch(e) {}
  530.             try {
  531.               var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  532.             } catch(e) {}
  533.             if (popupSetBox)
  534.               return popupSetBox.activeChild;
  535.             else if (menuBox)
  536.               return menuBox.activeChild;
  537.             throw Components.results.NS_ERROR_FAILURE;
  538.           ]]>
  539.         </getter>
  540.         <setter>
  541.           <![CDATA[
  542.             try {
  543.               var popupSetBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIPopupSetBoxObject);
  544.             } catch(e) {}
  545.             try {
  546.               var menuBox = this.parentNode.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject);
  547.             } catch(e) {}
  548.             if (popupSetBox)
  549.               return popupSetBox.activeChild = val;
  550.             else if (menuBox)
  551.               return menuBox.activeChild = val;
  552.             throw Components.results.NS_ERROR_FAILURE;
  553.           ]]>
  554.         </setter>
  555.       </property>
  556.     </implementation>     
  557.   </binding>
  558.   
  559.   
  560.   <!-- XUL <statusbar> -->
  561.   <binding id="statusbar" extends="xul:box"/>
  562.     
  563.   <binding id="statusbar-panel" extends="xul:button">
  564.     <content autostretch="never" valign="middle">
  565.       <xul:image class="statusbar-panel-icon" inherits="src"/>
  566.       <xul:text class="statusbar-panel-text" inherits="value=label,crop" crop="right" flex="1"/>
  567.     </content>
  568.     <implementation>
  569.       <property name="label"
  570.                 onget="return this.getAttribute('label');"
  571.                 onset="this.setAttribute('label',val); return val;"/>
  572.       <property name="src"
  573.                 onget="return this.getAttribute('src');"
  574.                 onset="this.setAttribute('src',val); return val;"/>
  575.     </implementation>
  576.   </binding>
  577.   
  578.   <binding id="browser">
  579.     <implementation>
  580.       <property name="docShell"
  581.                 readonly="true"
  582.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).docShell;"/>
  583.       <property name="webNavigation"
  584.                 readonly="true"
  585.                 onget="return this.docShell.QueryInterface(Components.interfaces.nsIWebNavigation);"/>
  586.       <property name="markupDocumentViewer"
  587.                 readonly="true"
  588.                 onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIMarkupDocumentViewer);"/>
  589.       <property name="contentViewerEdit"
  590.                 readonly="true"
  591.                 onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIContentViewerEdit);"/>
  592.       <property name="contentViewerFile"
  593.                 readonly="true"
  594.                 onget="return this.docShell.contentViewer.QueryInterface(Components.interfaces.nsIContentViewerFile);"/>
  595.       <property name="documentCharsetInfo"
  596.                 readonly="true"
  597.                 onget="return this.docShell.documentCharsetInfo;"/>
  598.     </implementation>
  599.   </binding>
  600.  
  601.   <binding id="editor">
  602.     <implementation>
  603.       <property name="editorShell"
  604.                 readonly="true"
  605.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIEditorBoxObject).editorShell"/>
  606.     </implementation>
  607.   </binding>
  608.  
  609.   <binding id="iframe">
  610.     <implementation>
  611.       <property name="docShell"
  612.                 readonly="true"
  613.                 onget="return this.boxObject.QueryInterface(Components.interfaces.nsIIFrameBoxObject).docShell"/>
  614.     </implementation>
  615.   </binding>
  616.  
  617.   <binding id="titledbox">
  618.     <content>
  619.       <xul:box class="titledbox-title" autostretch="never" orient="vertical">
  620.         <children includes="label"/>
  621.       </xul:box>
  622.       <xul:box flex="1" class="titledbox-body" inherits="orient,autostretch,align,valign">
  623.         <children/>
  624.       </xul:box>
  625.     </content>    
  626.   </binding>
  627.     
  628.   <binding id="label" extends="xul:box">
  629.     <content>
  630.       <xul:text inherits="value"/>
  631.     </content>
  632.   </binding>
  633.  
  634.   <binding id="autorepeatbutton-up">
  635.      <content>
  636.       <xul:image class="autorepeatbutton-up"/>
  637.    </content>
  638.   </binding>
  639.  
  640.   <binding id="autorepeatbutton-down">
  641.      <content>
  642.       <xul:image class="autorepeatbutton-down"/>
  643.    </content>
  644.   </binding>
  645.  
  646.   <binding id="scrollbox">
  647.     <content>
  648.     <xul:box class="scrollbox-innerbox" inherits="orient,autostretch,align,valign">
  649.       <children/>
  650.     </xul:box>
  651.   </content>
  652.   </binding>
  653.  
  654.   <binding id="arrowscrollbox">
  655.     <content>
  656.     <xul:vbox 
  657.     onunderflow="
  658.       var button1 = this.firstChild;
  659.       var button2 = this.childNodes[2];
  660.       button1.setAttribute('collapsed', 'true');
  661.       button2.setAttribute('collapsed', 'true');
  662.       " 
  663.     onoverflow="
  664.       var button1 = this.firstChild;
  665.       var button2 = this.childNodes[2];
  666.       button1.removeAttribute('collapsed');
  667.       button2.removeAttribute('collapsed');
  668.       ">
  669.     <xul:autorepeatbutton autostretch="never" class="up" collapsed="true" 
  670.         oncommand="parentNode.childNodes[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject).scrollByIndex(-1);"/>
  671.     <xul:scrollbox orient="vertical" flex="1">
  672.      <children/>
  673.     </xul:scrollbox>
  674.     <xul:autorepeatbutton autostretch="never" class="down" collapsed="true" 
  675.         oncommand="parentNode.childNodes[1].boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject).scrollByIndex(1);"/>
  676.     </xul:vbox>
  677.     </content>
  678.   </binding>
  679.  
  680. </bindings>
  681.  
  682.